Turn some simple softirqs into tasklets.
authorKeir Fraser <keir.fraser@citrix.com>
Fri, 11 Apr 2008 14:55:42 +0000 (15:55 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Fri, 11 Apr 2008 14:55:42 +0000 (15:55 +0100)
TRACE_SOFTIRQ does not appear to be necessary at all.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
xen/arch/x86/traps.c
xen/common/keyhandler.c
xen/common/trace.c
xen/include/xen/softirq.h

index d9e1b57b22303aa813164835492610997dfa8335..c9f879b351add05e2448377c27be35f36e3cdef5 100644 (file)
@@ -2637,12 +2637,14 @@ asmlinkage void do_general_protection(struct cpu_user_regs *regs)
     panic("GENERAL PROTECTION FAULT\n[error_code=%04x]\n", regs->error_code);
 }
 
-static void nmi_softirq(void)
+static void nmi_action(unsigned long unused)
 {
     /* Only used to defer wakeup of dom0,vcpu0 to a safe (non-NMI) context. */
     vcpu_kick(dom0->vcpu[0]);
 }
 
+static DECLARE_TASKLET(nmi_tasklet, nmi_action, 0);
+
 static void nmi_dom0_report(unsigned int reason_idx)
 {
     struct domain *d;
@@ -2654,7 +2656,7 @@ static void nmi_dom0_report(unsigned int reason_idx)
     set_bit(reason_idx, nmi_reason(d));
 
     if ( !test_and_set_bool(v->nmi_pending) )
-        raise_softirq(NMI_SOFTIRQ); /* not safe to wake up a vcpu here */
+        tasklet_schedule(&nmi_tasklet); /* not safe to wake a vcpu here */
 }
 
 asmlinkage void mem_parity_error(struct cpu_user_regs *regs)
@@ -2932,8 +2934,6 @@ void __init trap_init(void)
     percpu_traps_init();
 
     cpu_init();
-
-    open_softirq(NMI_SOFTIRQ, nmi_softirq);
 }
 
 long register_guest_nmi_callback(unsigned long address)
index b4144525625a0a1717d50630d45f0b12bc2c5484..934edb5dc9faa0421ad63797a810e74ccdfeda60 100644 (file)
@@ -32,7 +32,7 @@ static struct {
 
 static unsigned char keypress_key;
 
-static void keypress_softirq(void)
+static void keypress_action(unsigned long unused)
 {
     keyhandler_t *h;
     unsigned char key = keypress_key;
@@ -42,6 +42,8 @@ static void keypress_softirq(void)
     console_end_log_everything();
 }
 
+static DECLARE_TASKLET(keypress_tasklet, keypress_action, 0);
+
 void handle_keypress(unsigned char key, struct cpu_user_regs *regs)
 {
     irq_keyhandler_t *h;
@@ -56,7 +58,7 @@ void handle_keypress(unsigned char key, struct cpu_user_regs *regs)
     else
     {
         keypress_key = key;
-        raise_softirq(KEYPRESS_SOFTIRQ);
+        tasklet_schedule(&keypress_tasklet);
     }
 }
 
@@ -284,8 +286,6 @@ static void do_debug_key(unsigned char key, struct cpu_user_regs *regs)
 
 void __init initialize_keytable(void)
 {
-    open_softirq(KEYPRESS_SOFTIRQ, keypress_softirq);
-
     register_irq_keyhandler(
         'd', dump_registers, "dump registers");
     register_keyhandler(
index 863816b9eeeea851da58d2656e5f9a0225dfbaac..12ff7a029c6efd0663452d67ffab478bab7bea59 100644 (file)
@@ -69,12 +69,6 @@ static cpumask_t tb_cpu_mask = CPU_MASK_ALL;
 /* which tracing events are enabled */
 static u32 tb_event_mask = TRC_ALL;
 
-static void trace_notify_guest(void)
-{
-    send_guest_global_virq(dom0, VIRQ_TBUF);
-}
-
-
 /**
  * alloc_trace_bufs - performs initialization of the per-cpu trace buffers.
  *
@@ -120,7 +114,6 @@ static int alloc_trace_bufs(void)
     }
 
     t_buf_highwater = data_size >> 1; /* 50% high water */
-    open_softirq(TRACE_SOFTIRQ, trace_notify_guest);
 
     return 0;
 }
@@ -513,7 +506,7 @@ void __trace_var(u32 event, int cycles, int extra, unsigned char *extra_data)
     /* Notify trace buffer consumer that we've crossed the high water mark. */
     if ( started_below_highwater &&
          (calc_unconsumed_bytes(buf) >= t_buf_highwater) )
-        raise_softirq(TRACE_SOFTIRQ);
+        send_guest_global_virq(dom0, VIRQ_TBUF);
 }
 
 /*
index 440bfa6c6cb03f8442c0ee1a73879e137c567841..dbf460626135e8866adbc30d24fec5186eb24c9d 100644 (file)
@@ -6,10 +6,7 @@ enum {
     TIMER_SOFTIRQ = 0,
     SCHEDULE_SOFTIRQ,
     NEW_TLBFLUSH_CLOCK_PERIOD_SOFTIRQ,
-    KEYPRESS_SOFTIRQ,
-    NMI_SOFTIRQ,
     PAGE_SCRUB_SOFTIRQ,
-    TRACE_SOFTIRQ,
     RCU_SOFTIRQ,
     STOPMACHINE_SOFTIRQ,
     TASKLET_SOFTIRQ,